<?php

class ErrorController extends Zend_Controller_Action
{
    public function errorAction()
    {
        $exception = $this->_getParam('error_handler')->exception;
	
   echo $exception;

        if ($exception instanceof Zend_Controller_Exception){
	     		
              $this->view->message = 'Página no encontrada';
              $this->view->location = '/';
        }
        elseif ($exception instanceof X\Exception){

            $this->view->message = $exception->message;
            $this->view->location = $exception->location;
        }
        else{
            $this->view->message = $exception->getMessage();
            $this->view->location = '/';
        }
    }
}

